<%@page import="model.ShareUser"%>
<%@page import="java.util.*"%>
<%@page import="dao.UtilisateurDAO"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<jsp:include page="/WEB-INF/headerProfil.jsp" />


<article class="module width_3_quarter">

	<header>
		<h3 class="tabs_involved">Partages reçus</h3>
	</header>

	<div class="tab_container">
		<div class="tab_content">
			<table class="tablesorter" cellspacing="0">
				<thead>
					<tr>
						<th>Envoyeur</th>
						<th>Partage</th>
						<th>Date de création</th>
						<th>Dernière modification</th>
					</tr>
				</thead>
				<tbody>
					<%
						UtilisateurDAO uDAO = new UtilisateurDAO();
						session = request.getSession();
						ShareUser user = uDAO.getUserByLogin((String) session
								.getAttribute("user"));

						for (model.Share share : user.getReceive()) {
							java.util.Date dateCreation = new Date(
									share.getDateCreationShare());
							java.util.Date dateLastModification = new Date(
									share.getDateLastModificationShare());
							out.print("<tr><td>"
									+ uDAO.getUserById((int) share.getIdSender())
											.getLogin() + "</td><td>"
									+ share.getNameShare() + "</td><td>"
									+ dateCreation.toLocaleString() + "</td><td>"
									+ dateLastModification.toLocaleString() + "</td></tr>");
						}
					%>
				</tbody>
			</table>
		</div>
	</div>

</article>

</section>


</body>

</html>
